package material.factory;

/**
 * 使用工厂原料的纽约风味的披萨超市
 */
public class NYPizzaStore02 extends PizzaStore02 {
    @Override
    Pizza02 createPizza(String type) {
        Pizza02 pizza = null;
        PizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();//纽约店全用到纽约披萨原料工厂
        if (type.equals("cheese")) {
            pizza = new CheesePizza02(ingredientFactory);
            pizza.setName("纽约风味的芝士披萨");
        } else if (type.equals("veggie")) {
            pizza = new VeggiePizza02(ingredientFactory);
            pizza.setName("纽约风味的蔬菜披萨");
        } else if (type.equals("clam")) {
            pizza = new ClamPizza02(ingredientFactory);
            pizza.setName("纽约风味的蛤蜊披萨");
        } else if (type.equals("peoperoni")) {
            pizza = new PepperoniPizza02(ingredientFactory);
            pizza.setName("意大利辣味香肠");
        }
        return pizza;
    }
}
